#include<iostream>
using namespace std;

class ExceptionClass{
private:
	int num;
public:
	ExceptionClass(){}
	ExceptionClass(int n){
		num=n;
	}
	int getNum(){
		return num;
	}
};

void sqap(int d) throw(ExceptionClass,int){
	int e1=2;
				if(d<=0){
					throw ExceptionClass(0);
				}
				if(d==1){
					throw ExceptionClass(1);
				}
				if(d==2){
								throw e1;
				}
}

int main10(){
	int d,m=10;
	int e1=2;
	do{
		try{
			cin>>d;
			sqap(d);

			cout<<m/d<<endl;
		}catch(ExceptionClass e){
			cout<<"程序异常了ExceptionClass"<<e.getNum()<<endl;
		}
	}while(1);
	cout<<"end!"<<endl;
	return 0;
}
